package com.zyz.K_集合.Map接口二LinkedHashMap;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

/**
 * @author: vick
 * @Date: 2025/3/30
 * @Description:
 * @version: 1.0
 */
public class Test {
    public static void main(String[] args) {
        LinkedHashMap hashMap = new LinkedHashMap();
        hashMap.put("王五", 13000.0);
        hashMap.put("张三", 10000.0);
        hashMap.put("牛三", 102000.0);
        //覆盖原来的value
        hashMap.put("张三", 10300.0);
        hashMap.put(null, null);
        System.out.println(hashMap);

        Set entrySet = hashMap.entrySet();
        for (Object set : entrySet) {
            Map.Entry entry = (Map.Entry) set;
            System.out.println(entry);
        }
    }
}
